package mr.ali.videoapp.portal.controller;


import com.github.pagehelper.PageInfo;
import mr.ali.videoapp.portal.model.CollectionRecommend;
import mr.ali.videoapp.portal.service.ICollectionRecommendService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author Mr-ali
 * @since 2025-07-09
 */
@RestController
@RequestMapping("/portal/collectionRecommend")
public class CollectionRecommendController {

    @Resource
    private ICollectionRecommendService collectionRecommendService;

    @GetMapping("/all")
    public PageInfo<CollectionRecommend> findAll(Integer pageNum, Integer pageSize, Integer userId, Integer videoId) {
        return collectionRecommendService.findAll(pageNum, pageSize, userId, videoId);
    }

    @GetMapping("/delete")
    public Integer delete(Integer userId, Integer videoId) {
        return collectionRecommendService.delete(userId, videoId);
    }

    @GetMapping("/insert")
    public Integer insert(Integer userId, Integer videoId) {
        return collectionRecommendService.insert(userId, videoId);
    }

}
